// 导入views目录下的组件
import App from '../App'
import Home from '../views/Home'
import Bang from '../views/Bang'
import Category from '../views/Category'
import Error from '../views/Error'
import Index from '../views/Index'
import Collect from '../views/Collect'
import Day from '../views/Day'
import Search from '../views/Search'
import Detail from '../views/Detail'
import Chapter from '../views/Chapter'
import Login from '../views/Login'
import Register from '../views/Register'
import Profile from '../views/Profile'
import Update from '../views/Update'
import Setting from '../views/Setting'
// 配置路由表(设置URL和组件的映射关系  URL和组件一一对应 )
const routes = [
    // 嵌套路由
    {
        path: '',
        element: <App/>,
        children:[
            {
                path:'',
                element:<Index/>
            },
            {
                path:'index',
                element:<Index/>
            },
            {
                path:'collect',
                element:<Collect/>
            },
            {
                path:'home',
                element:<Home/>
            },
        ]
    },
    {
        path:'bang',
        element:<Bang/>
    },
    {
        path:'category',
        element:<Category/>
    },
    {
        path:'day',
        element:<Day/>
    },
    {
        path:'search',
        element:<Search/>
    },
    {
        path:'detail',
        element:<Detail/>
    },
    {
        path:'chapter',
        element:<Chapter/>
    },
    {
        path:'login',
        element:<Login/>
    },
    {
        path:'register',
        element:<Register/>
    },
    {
        path:'profile',
        element:<Profile/>
    },
    {
        path:'update',
        element:<Update/>
    },
    {
        path:'setting',
        element:<Setting/>
    },
    {
        path:'*',
        element:<Error/>
    },
]

// 导出路由表
export default routes